//---------------------------------------------------------------------------

#ifndef TArresterPictureH
#define TArresterPictureH

#include <ExtCtrls.hpp>

#include "TArrester.h"
#include "TTrackRetarder.h"
#include "TTrack.h"
#include "TCut.h"
#include "TSpeedTimePosition.h"

//---------------------------------------------------------------------------

class TPosSpeed
{
	public:
		int Speed;
		int Position;
};

//---------------------------------------------------------------------------
class TArresterPicture
{
	public:
		TCanvas *ShowCanvas;
		Graphics::TBitmap *BackgroundBitmap;
		Graphics::TBitmap *ShowBitmap;

		TTracks Tracks;
		float BeginPos, EndPos;
		float MaxSpeed;
		float MaxCarHeight;

		TArresterPicture();
		~TArresterPicture();
		bool __fastcall Initialize(TCanvas * Canvas,
											const int BitmapWidth,
											const int BitmapHeight,
											const int BitmapTop,
											const int BitmapLeft,
											TCuts * Cuts,
											TArresters * Arresters,
											TTrackRetarders * TrackRetarders,
											const float NewMaxSpeed,
											const float StopPoint,
											const TMeasurementRate NewMeasurementRate,
											const eLanguage Language);
		void __fastcall DrawInitMap(void);
		void __fastcall MoveCuts(const TCuts Cuts);
		bool __fastcall DrawWholePicture(TImage * ShowImage, TVTS VTS, TCuts Cuts);
		void __fastcall DrawStopLength(const float StopPositon);

	private:
		int Top, Left;
		int PlanHeight, ProfileHeight;
		int PlanBase, ProfileBase, SpeedBase, CutsAnimalBase, ParameterBase, RetarderBase;
		float XScale, YScale;
		int TenLengthGraduationHeight, HundredLengthGraduationHeight, SpeedGraduationWidth;
		TMeasurementRate MeasurementRate;
		float FStopPoint;
		float SpeedScale;
		bool Drawed;
		vector <TPosSpeed> SpeedPos;
		vector <Graphics::TBitmap *> CutsBitmaps;
		eLanguage InterfaceLanguage;
		AnsiString Caption;
		AnsiString TotalArresterQuantity;
		AnsiString TotalWagonQuantity;
		AnsiString No;
		AnsiString Weight;
		AnsiString WagonQuantity;
		AnsiString Speed;
		AnsiString Position;

		void __fastcall SetBase(void);
		void __fastcall DrawGraduation(void);
		void __fastcall DrawSpeedGraduation(void);
		void __fastcall DrawLengthGraduate(const int Graduate, const int GraduateHeight, const bool Show);
		void __fastcall WriteParameter(TCuts * Cuts, TArresters * Arresters);
		void __fastcall DrawArresters(const TArresters Arresters);
		void __fastcall DrawAllSpeedCurve(TVTS VTS, TCuts Cuts);
		void __fastcall ShowFinishCutsPicture(TCuts Cuts);
		bool __fastcall Change(TCuts Cuts);
		void __fastcall DrawStopPoint(void);
		bool __fastcall ReadIniFile(const eLanguage Language);
};

#endif
